package object_structure;

import element.Animal;
import visitor.Person;

import java.util.ArrayList;
import java.util.List;

public class Home {

    private List<Animal> nodeList = new ArrayList<>();

    public void action(Person person){
        nodeList.forEach(animal -> animal.accept(person));
    }

    public void add(Animal animal){
        nodeList.add(animal);
    }
}
